{% extends "base.html" %}
{% block title %}{% endblock %}
{% block content %}

<div class="layui-body" style="overflow:auto;left:1px">
    <div class="layui-card-header">我的统计</div>
    <div class="layui-card-body">
        <li class="layui-col-xs6"
            style="width: 20%;background-color:#f8f8f8;padding:10px 15px;color:#999;border-radius:2px ">
            <h3>未完成任务数</h3><br>
            <p>
                <cite style="font-style: normal;font-size: 30px;font-weight: 300;color: red">{{ALLMyData.total_process_task}}</cite>
            </p>
            <br>
        </li>
        <li class="layui-col-xs6"
            style="width: 20%;background-color:#f8f8f8;padding:10px 15px;color:#999;border-radius:2px ">
            <h3>所有的任务数</h3><br>
            <p>
                <cite style="font-style: normal;font-size: 30px;font-weight: 300;color: green">{{ALLMyData.total_task}}</cite>
            </p>
            <br>
        </li>
        <li class="layui-col-xs6"
            style="width: 20%;background-color:#f8f8f8;padding:10px 15px;color:#999;border-radius:2px ">
            <h3>创建的用例数</h3><br>
            <p>
                <cite style="font-style: normal;font-size: 30px;font-weight: 300;color: green">{{ALLMyData.crt_case}}</cite>
            </p>
            <br>
        </li>

        <li class="layui-col-xs6"
            style="width: 20%;background-color:#f8f8f8;padding:10px 15px;color:#999;border-radius:2px ">
            <h3>创建的接口数</h3><br>
            <p>
                <cite style="font-style: normal;font-size: 30px;font-weight: 300;color: green">{{ALLMyData.crtApi}}</cite>
            </p>
            <br>
        </li>

        <li class="layui-col-xs6"
            style="width: 20%;background-color:#f8f8f8;padding:10px 15px;color:#999;border-radius:2px ">
            <h3>执行的用例数</h3><br>
            <p>
                <cite style="font-style: normal;font-size: 30px;font-weight: 300;color: green">{{ALLMyData.doResult}}</cite>
            </p>
            <br>
        </li>

        <li class="layui-col-xs6"
            style="width: 20%;background-color:#f8f8f8;padding:10px 15px;color:#999;border-radius:2px ">
            <h3>执行失败的用例数</h3><br>
            <p>
                <cite style="font-style: normal;font-size: 30px;font-weight: 300;color: red">{{ALLMyData.failResult}}</cite>
            </p>
            <br>
        </li>

        <li class="layui-col-xs6"
            style="width: 20%;background-color:#f8f8f8;padding:10px 15px;color:#999;border-radius:2px ">
            <h3>用例的缺陷率</h3><br>
            <p>
                <cite style="font-style: normal;font-size: 30px;font-weight: 300;color: red">{{ALLMyData.caseFailRate}}%</cite>
            </p>
            <br>
        </li>

    </div>

    <hr class="layui-bg-gray">
    <div class="layui-card-header">所有用户用例发现率排列</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="userOder" lay-filter="userOder"></table>
    </div>
    <br>
    <hr class="layui-bg-gray">
    <div class="layui-card-header">所有项目用例发现率排列</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="pjtOder" lay-filter="userOder"></table>
    </div>

    <br>
    <hr class="layui-bg-gray">
    <div class="layui-card-header">所有用户的相关数据</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="allUser" lay-filter="allUser"></table>
    </div>
</div>
</div>
<script>
    layui.use(['table','code'], function(){
          var table = layui.table
          ,form = layui.form;
          var $= layui.jquery;

          var  options = {
                elem:'#userOder',
                skin:"line",
                page:false,
                limit:1000,
                limits:[10,20,30],
                //height: 'full-400',
                url:'/total/user/order',
                where:{
                },
                response:{
                    statusName:'errorCode',
                    statusCode:'',
                    dataName:'data'
                },
                cols:[[
                      {field: 'userNameOrder', title: '姓名',sort:true}
                      ,{field: 'dCase', title: '执行用例数',sort:true}
                      ,{field: 'doCaseFail', title: '执行用例失败数',sort:true}
                      ,{field: 'caseFailRate', style:"color:red",title: '用例失败率',sort:true, templet: function (d) {
                          return d.caseFailRate + '%';
                      }}

                ]],
                id:'userOder',
                done:function(res,cur,count){
                }
              };
          var tableIns = table.render(options);

          var  options2 = {
                elem:'#pjtOder',
                skin:"line",
                page:false,
                limit:1000,
                limits:[10,20,30],
                //height: 'full-400',
                url:'/total/project/order',
                where:{
                },
                response:{
                    statusName:'errorCode',
                    statusCode:'',
                    dataName:'data'
                },
                cols:[[
                      {field: 'projectName', title: '项目名称',sort:true}
                      ,{field: 'dCase', title: '执行用例数',sort:true}
                      ,{field: 'doCaseFail', title: '执行用例失败数',sort:true}
                      ,{field: 'caseFailRate', style:"color:red",title: '用例失败率',sort:true, templet: function (d) {
                          return d.caseFailRate + '%';
                      }}

                ]],
                id:'userOder',
                done:function(res,cur,count){
                }
              };
          var tableIns = table.render(options2);

          var  options3 = {
                elem:'#allUser',
                skin:"line",
                page:false,
                limit:1000,
                //height: 'full-400',
                limits:[10,20,30],
                url:'/total/allUser/order',
                where:{
                },
                response:{
                    statusName:'errorCode',
                    statusCode:'',
                    dataName:'data'
                },
                cols:[[
                      {field: 'userName', title: '用户名',sort:true}
                      ,{field: 'total_task', title: '所有任务数',sort:true}
                      ,{field: 'total_process_task', title: '进行任务数',sort:true}
                      ,{field: 'crt_case', title: '创建用例数',sort:true}
                      ,{field: 'doResult', title: '执行用例数',sort:true}
                      ,{field: 'failResult', title: '用例失败数',sort:true}
                      ,{field: 'crtApi', title: '创建接口用例数',sort:true}
                      ,{field: 'caseFailRate', style:"color:red",title: '用例失败率',sort:true, templet: function (d) {
                          return d.caseFailRate + '%';
                      }}

                ]],
                id:'userOder',
                done:function(res,cur,count){
                }
              };
          var tableIns = table.render(options3);

    });


</script>
{% endblock %}